<?php


namespace App\Http\Controllers\admin\api;


use App\Http\Controllers\admin\service\GankaoService;
use App\Http\Controllers\admin\validate\Gankao;
use App\Http\Controllers\utils\ToolUtil;
use Illuminate\Http\Request;

class GankaoApi
{
    public function editCardInfo(Request $request){
        $param = $request->all();
        $data = Gankao::editCardInfo($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return GankaoService::editCardInfo($param);
    }

    public function cancelCardInfo(Request $request){
        $param = $request->all();
        $data = Gankao::cancelCardInfo($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return GankaoService::cancelCardInfo($param);
    }

    public function upgrade(Request $request){
        $param = $request->all();
        $data = Gankao::upgrade($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return GankaoService::upgrade($param);
    }

}